package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.EnterpriseRelationship;
import com.ruoyi.system.mapper.EnterpriseRelationshipMapper;
import com.ruoyi.system.service.IEnterpriseRelationshipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 企业关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-24
 */
@Service
public class EnterpriseRelationshipServiceImpl implements IEnterpriseRelationshipService
{
    @Autowired
    private EnterpriseRelationshipMapper enterpriseRelationshipMapper;

    /**
     * 查询企业关系
     *
     * @param cooperationId 企业关系主键
     * @return 企业关系
     */
    @Override
    public EnterpriseRelationship selectEnterpriseRelationshipByCooperationId(Integer cooperationId)
    {
        return enterpriseRelationshipMapper.selectEnterpriseRelationshipByCooperationId(cooperationId);
    }

    /**
     * 查询企业关系列表
     * 
     * @param enterpriseRelationship 企业关系
     * @return 企业关系
     */
    @Override
    public List<EnterpriseRelationship> selectEnterpriseRelationshipList(EnterpriseRelationship enterpriseRelationship)
    {
        return enterpriseRelationshipMapper.selectEnterpriseRelationshipList(enterpriseRelationship);
    }

    /**
     * 新增企业关系
     * 
     * @param enterpriseRelationship 企业关系
     * @return 结果
     */
    @Override
    public int insertEnterpriseRelationship(EnterpriseRelationship enterpriseRelationship)
    {
        return enterpriseRelationshipMapper.insertEnterpriseRelationship(enterpriseRelationship);
    }

    /**
     * 修改企业关系
     * 
     * @param enterpriseRelationship 企业关系
     * @return 结果
     */
    @Override
    public int updateEnterpriseRelationship(EnterpriseRelationship enterpriseRelationship)
    {
        return enterpriseRelationshipMapper.updateEnterpriseRelationship(enterpriseRelationship);
    }

    /**
     * 批量删除企业关系
     * 
     * @param cooperationIds 需要删除的企业关系主键
     * @return 结果
     */
    @Override
    public int deleteEnterpriseRelationshipByCooperationIds(Integer[] cooperationIds)
    {
        return enterpriseRelationshipMapper.deleteEnterpriseRelationshipByCooperationIds(cooperationIds);
    }

    /**
     * 删除企业关系信息
     * 
     * @param cooperationId 企业关系主键
     * @return 结果
     */
    @Override
    public int deleteEnterpriseRelationshipByCooperationId(Integer cooperationId)
    {
        return enterpriseRelationshipMapper.deleteEnterpriseRelationshipByCooperationId(cooperationId);
    }
}
